package com.loy.service.impl;

import com.loy.inter.RestService;
import org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@Service
public class RestConsummerServiceImpl implements RestService {

    private final RestTemplate restTemplate = RestTemplateBuilder.create();
    @Override
    public String sayRest(String s) {
        String serviceName ="provider";
        String forObject = restTemplate.getForObject("cse://" + serviceName + "/hello" + "/hello", String.class);
        return forObject;
    }
}
